GtkWidget: Ensure name changes involve a style context update.
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 29 Oct 2010 04:01:51 +0000 (06:01 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:38:29 +0000 (15:38 +0100)
gtk/gtkwidget.c

index d1765ec4c72feda4ac224f6b2b971cd8c2be1155..f038d7aea4b13e09c1a4fc4f5a44d3096b2957ef 100644 (file)
@@ -6666,6 +6666,18 @@ gtk_widget_set_name (GtkWidget    *widget,
   g_free (priv->name);
   priv->name = new_name;
 
+  if (priv->path)
+    {
+      guint pos;
+
+      pos = gtk_widget_path_length (priv->path) - 1;
+      gtk_widget_path_iter_set_name (priv->path, pos,
+                                     priv->name);
+    }
+
+  if (priv->context)
+    gtk_style_context_set_path (priv->context, priv->path);
+
   if (priv->rc_style)
     gtk_widget_reset_rc_style (widget);